package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.BankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;


/**
 * @author 86188
 */

@RestController("agencyBankAccountController")
@RequestMapping("/agency")
@Api(tags = "机构端 - 账户设置相关接口")
@Slf4j
public class BankAccountController {

    @Resource
    private BankAccountService bankAccountService;
    @PostMapping("/bank-account")
    @ApiOperation("添加服务端银行账户信息")
    public void addBankAccountInfo(@RequestBody BankAccountUpsertReqDTO dto) {
       log.info("获取到的数据为{}", dto);
        bankAccountService.addBankAccountInfo(dto);
    }


    @GetMapping("/bank-account/currentUserBankAccount")
    @ApiOperation("查询服务端当前用户银行账户信息")
    public BankAccountResDTO queryBankAccountInfo() {
        return bankAccountService.findCurrentUserBankAccountInfo();
    }
}
